home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / batch / tsbat36.zip / SETPRN.BAT < prev    next >
DOS Batch File  |  1991-03-13  |  3KB  |  85 lines

  1. echo off
  2.  
  3. rem SETPRN.BAT
  4.  
  5. rem If you get an "Out of environment space" message, increase your
  6. rem environment space by using shell configuration in config.sys:
  7. rem MsDos 3.30 example: shell=c:\bin\command.com /e:1024 /p
  8.  
  9. rem Check that ask.exe is available at path or the current directory
  10. set _found=no
  11. if exist ask.exe set _found=yes
  12. for %%d in (%path%) do if exist %%d\ask.exe set _found=yes
  13. if "%_found%"=="no" goto _err2
  14.  
  15. :_begin
  16. cls
  17. echo ┌───────────────────────────────────────────────────────────────────┐
  18. echo │ Set an Epson compatible printer (Diconix 150) from a batch menu   │
  19. echo │ By Prof. Timo Salmi, ts@chyde.uwasa.fi, Vaasa, Finland, 13-Mar-91 │
  20. echo └───────────────────────────────────────────────────────────────────┘
  21. echo 
  22.  
  23. rem Make a menu, liven it up with colors
  24. echo ┌───────────────────────────────┐
  25. echo │ 0) Exit the menu              │
  26. echo │ 1) Reset printer              │
  27. echo │ 2) Wide condensed             │
  28. echo │ 3) Wide condensed, Emphasized │
  29. echo │ 4) Condensed                  │
  30. echo │ a) Spacing 75                 │
  31. echo │ b) Spacing 80                 │
  32. echo │ c) Spacing 90                 │
  33. echo │ d) Spacing 100                │
  34. echo │ e) Spacing 123                │
  35. echo │ f) Spacing 137.5              │
  36. echo │ g) Spacing 150                │
  37. echo │ h) Spacing 200                │
  38. echo └───────────────────────────────┘
  39.      
  40. rem Make the choice and set the code for the printer
  41. echo 
  42. ask Select: /l /d
  43. set _code=
  44. if errorlevel==48 if not errorlevel==49 set _code=_exit
  45. if errorlevel==49 if not errorlevel==50 set _code=@
  46. if errorlevel==50 if not errorlevel==51 set _code=!$
  47. if errorlevel==51 if not errorlevel==52 set _code=!,
  48. if errorlevel==52 if not errorlevel==53 set _code=!
  49. if errorlevel==97 if not errorlevel==98 set _code=
  50. if errorlevel==98 if not errorlevel==99 set _code=&
  51. if errorlevel==99 if not errorlevel==100 set _code=+
  52. if errorlevel==100 if not errorlevel==101 set _code=
  53. if errorlevel==101 if not errorlevel==102 set _code=
  54. if errorlevel==102 if not errorlevel==103 set _code=B
  55. if errorlevel==103 if not errorlevel==104 set _code=H
  56. if errorlevel==104 if not errorlevel==105 set _code=`
  57.  
  58. if "%_code%"=="_exit" goto _out
  59. if "%_code%"=="" goto _err1
  60.  
  61. rem Send the code to the printer
  62. echo %_code% > prn
  63.  
  64. :_again
  65. ask Select from the menu again (y/n)? /u /d
  66. if errorlevel==89 if not errorlevel==90 goto _begin
  67. if errorlevel==78 if not errorlevel==79 goto _out
  68. echo 
  69. goto _again
  70.  
  71. :_err1
  72. echo No such choice available
  73. goto :_again
  74.  
  75. :_err2
  76. echo 
  77. echo You must have ask.exe at your path (or the current directory)
  78. goto _out
  79.  
  80. :_out
  81. set _code=
  82. set _found=
  83. echo 
  84. echo on
  85.